<?php

/**
 * event actions.
 *
 * @package    Nika
 * @subpackage event
 * @author     Alexey Shapran (alexey.shapran@gmail.com)
 * @version    SVN: $Id: actions.class.php 23810 2009-11-12 11:07:44Z Kris.Wallsmith $
 */
class commentComponents extends sfComponents
{
	public function executeShowlist(sfWebRequest $request)
	{
		$this->comments = Comment::viewcomments($this->entity_id, $this->entity_type);
		$this->form = new CommentForm();

		$this->allowdeleteanothercomment = false;
		if ($this->entity_type == 'media')
		{
			$this->phot = Media::retrieveUserIdByMediaFileId($this->entity_id);

			if ($this->getUser()->isAuthenticated())
			{
			if ( $this->phot['user_id'] == $this->getUser()->getGuardUser()->getId() )
			$this->allowdeleteanothercomment = true;
			}
		}
	}
}